<%--
  Created by IntelliJ IDEA.
  User: cys
  Date: 2017/10/9
  Time: 20:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>自我介绍</title>
    <script type="text/javascript" src="../../static/common/ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="../../static/common/jquery/jquery-1.11.1.min.js"></script>
    <link rel="stylesheet" href="../../static/common/layui/css/layui.css">
    <script src="../../static/common/axios.min.js"></script>
    <script src="../../static/common/vue.min.js"></script>
    <script src="../../static/common/layui/layui.js"></script>
</head>
<body>
    <div id="Vue" v-cloak >
        <div class="admin-main" >
            <div v-if=" selfintro == '' ">
            <blockquote class="layui-elem-quote">
                    <a href="#" class="layui-btn layui-btn-small"  display:none onclick="location='/student/selfintro?intro='+selfintro+'&id='+userid">
                        <i class="layui-icon">&#xe608;</i> 添加自我介绍
                    </a>
            </blockquote>
            </div>
            <div v-else= "selfintro != ''">
                <blockquote class="layui-elem-quote">
                    <a href="#" class="layui-btn layui-btn-small" display:none onclick="location='/student/selfintro?intro='+selfintro+'&id='+userid">
                        <i class="layui-icon">&#xe608;</i> 修改自我介绍
                    </a>
                </blockquote>
            </div>
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;"display:none>
                <legend>自我介绍</legend>
            </fieldset>
            <div v-if= "selfintro != ''">
            <div class="layui-form-item"display:none>
                <div style="margin-left: 110px;">
                        <div name="content" class="layui-textarea"  style="overflow:auto;height: 600px;width:1000px;"disabled="disabled" id="intro"></div>
                </div>
            </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        var userid = ${sessionScope.currentUser.getId()};
    </script>
    <script>

        layui.config({
            base: '../../static/js/layuiModulesEX/'
        });
        layui.use(['form','laytpl']),function () {
            var form = layui.form(),
                laytpl = layui.laytpl;

        }
        var selfintro="";
        axios.get('/student/findDetail/'+userid)
            .then(function (response) {
                selfintro = response.data.data.studentInfo.selfintro;
                console.log(selfintro);
                var vm = new Vue({
                    el:'#Vue'
                })
                var divshow = $("#intro");
                divshow.text("");// 清空数据
                divshow.html(selfintro);
        })
            .catch(function (msg) {
                console.log(msg);
            })
        console.log(selfintro);
    </script>
</body>
</html>
